<html>
<head><meta charset="utf-8"><title>force warn · edition 2021 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/index.html">edition 2021</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html">force warn</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="236214729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/236214729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#236214729">(Apr 26 2021 at 17:42)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  Regarding your gist on <code>--force-warn</code>, I don't think there <em>should</em> be any problems with multiple group membership. <code>warn(group)</code> behaves as-if it expands to a list of the members of that group. Source-order conflicts are already handled (in the same way was nested scopes are handled). I recently wrote some clarification of the behavior in <a href="https://github.com/rust-lang/reference/pull/998">here</a>. I'm not aware of any diagnostics that deal with lint groups. I just did a quick test, and it seems to work as expected.</p>



<a name="236223249"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/236223249" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#236223249">(Apr 26 2021 at 18:39)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> good to know!</p>



<a name="236394521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/236394521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#236394521">(Apr 27 2021 at 19:26)</a>:</h4>
<p>We discussed --force-warn in the Cargo meeting today. A thought occurred to me about the solution here:</p>



<a name="236394619"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/236394619" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#236394619">(Apr 27 2021 at 19:27)</a>:</h4>
<p>This is effectively adding a new lint level. Just as <code>forbid</code> is "<code>error</code> and you can't turn it off", this is <code>forewarn</code> (non-joking name needs bikeshedding): "<code>warn</code> and you can't turn it off".</p>



<a name="236394706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/236394706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#236394706">(Apr 27 2021 at 19:28)</a>:</h4>
<p>I think if we added that as a fifth lint level, we could then add a compiler option to enable that lint level.</p>



<a name="236394782"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/236394782" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#236394782">(Apr 27 2021 at 19:28)</a>:</h4>
<p>And it'd generalize to two orthogonal controls: lint level (allow/warn/error) and minimum required lint level (allow (default)/warn (forewarn)/error (forbid)).</p>



<a name="236394801"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/236394801" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mario Carneiro <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#236394801">(Apr 27 2021 at 19:29)</a>:</h4>
<p>currently all the lint levels are totally ordered by "severity", where would forewarn go?</p>



<a name="239246417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/239246417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#239246417">(May 18 2021 at 12:46)</a>:</h4>
<p>Following up on this channel</p>



<a name="239599247"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/239599247" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#239599247">(May 20 2021 at 14:19)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> I realize I said chat on Zulip :)</p>



<a name="239599268"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/239599268" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#239599268">(May 20 2021 at 14:19)</a>:</h4>
<p>I'm here, anyhow</p>



<a name="240622521"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/240622521" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#240622521">(May 28 2021 at 15:43)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I guess the only thing I'd want to know is what the right way to introduce a new command line option is. Does this need to be behind a -Z option?</p>



<a name="240628181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/240628181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#240628181">(May 28 2021 at 16:27)</a>:</h4>
<p>The initial PR is up: <a href="https://github.com/rust-lang/rust/pull/85788">https://github.com/rust-lang/rust/pull/85788</a></p>



<a name="240951886"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/240951886" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#240951886">(Jun 01 2021 at 14:40)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> since this is on a path to stabilization, I'd probably make it an unstable option that requires <code>-Zunstable-options</code></p>



<a name="240951895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/240951895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#240951895">(Jun 01 2021 at 14:40)</a>:</h4>
<p>I'll take a look at the PR</p>



<a name="240970564"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/240970564" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#240970564">(Jun 01 2021 at 16:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> FYI: I took a look and the lint groups are expanded before the code  I've changed is run. So it only sees the expanded list. I tried to quickly find where the expansion is happening, but I've not found it yet.</p>



<a name="241080254"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241080254" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241080254">(Jun 01 2021 at 21:49)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> ok, I'll try to take a look now</p>



<a name="241081308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241081308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241081308">(Jun 01 2021 at 22:00)</a>:</h4>
<p>ack, ran out of time, will tackle</p>



<a name="241093269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241093269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241093269">(Jun 02 2021 at 00:39)</a>:</h4>
<p>OK, <span class="user-mention" data-user-id="224872">@rylev</span> <a href="https://github.com/rust-lang/rust/pull/85788#pullrequestreview-673693402">thoughts here</a></p>



<a name="241093604"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241093604" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241093604">(Jun 02 2021 at 00:44)</a>:</h4>
<p>I wanted to mention, I'm wondering if <code>force-warn</code> or something like it could be used as an alternative implementation for the future-incompatible reports.  I was wondering how it might interact with <code>--cap-lints</code>?</p>



<a name="241094513"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241094513" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241094513">(Jun 02 2021 at 00:57)</a>:</h4>
<p>Also, regarding the note on the PR about "if a lint is a higher level (denied), should it be a warning, or left as an error", I hadn't thought about that much. For the <code>fix</code> use case, I don't think it matters either way.  And my desire to use it for future-incompat doesn't matter either.   If you do decide to leave it as an error, my only concern is that the name of the flag might be a little confusing.  But I can't think of a use case where it would matter.</p>



<a name="241148373"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241148373" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241148373">(Jun 02 2021 at 13:29)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> are you thinking that the flag would be used to dump JSON that would be gathered up by cargo?</p>



<a name="241148415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241148415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241148415">(Jun 02 2021 at 13:29)</a>:</h4>
<p>it feels like the right behavior, given the name, is to make it a <em>warning</em>, regardless</p>



<a name="241164797"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241164797" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241164797">(Jun 02 2021 at 15:21)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I updated the PR and have warnings working based on lint group as well. This should be done though we need to come to a decision about the issue <span class="user-mention" data-user-id="120518">@Eric Huss</span> mentions. I agree that given the name it probably makes sense to downgrade denied lints to warnings, but I'm also not sure how useful that is.</p>



<a name="241164875"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241164875" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241164875">(Jun 02 2021 at 15:22)</a>:</h4>
<p>It does depend on what we expect to use it for, I suppose</p>



<a name="241164942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241164942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241164942">(Jun 02 2021 at 15:22)</a>:</h4>
<p>cc <span class="user-mention" data-user-id="116083">@pnkfelix</span>, since we are discussing the "future compatibility warnings" discussion</p>



<a name="241164963"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241164963" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241164963">(Jun 02 2021 at 15:22)</a>:</h4>
<p>I think that in that case, warning is exactly what we would want</p>



<a name="241165231"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165231" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165231">(Jun 02 2021 at 15:24)</a>:</h4>
<p>I actually just wrote a test case for this, and I was wrong. It seems that deny-by-default lints are properly downgraded.</p>



<a name="241165253"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165253" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165253">(Jun 02 2021 at 15:24)</a>:</h4>
<p>that is what I would expect</p>



<a name="241165263"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165263" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165263">(Jun 02 2021 at 15:24)</a>:</h4>
<p>based on the code</p>



<a name="241165287"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165287" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165287">(Jun 02 2021 at 15:25)</a>:</h4>
<p>Let me push the test</p>



<a name="241165296"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165296" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165296">(Jun 02 2021 at 15:25)</a>:</h4>
<p>in practice, of course, we would be using this in conjunction with cap-lints</p>



<a name="241165475"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165475" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165475">(Jun 02 2021 at 15:26)</a>:</h4>
<p>Test pushed. Ok - I think this is ready to be merged from my side. <span aria-label="blush" class="emoji emoji-1f60a" role="img" title="blush">:blush:</span></p>



<a name="241165602"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165602" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165602">(Jun 02 2021 at 15:27)</a>:</h4>
<p>I just pushed a request for changes</p>



<a name="241165614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165614">(Jun 02 2021 at 15:27)</a>:</h4>
<p>one nit, plus we should add this to the unstable book</p>



<a name="241165738"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165738" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165738">(Jun 02 2021 at 15:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ah also, I wasn't sure how to test that the command line option is unstable (other than manually testing) - it seems that the UI tests allow you to specify unstable options without explicitly adding the unstable options flag.</p>



<a name="241165771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165771">(Jun 02 2021 at 15:28)</a>:</h4>
<p>probably the UI framework adds that option for you</p>



<a name="241165785"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165785" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165785">(Jun 02 2021 at 15:28)</a>:</h4>
<p>I'm not sure how best to do that either</p>



<a name="241165807"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165807" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165807">(Jun 02 2021 at 15:28)</a>:</h4>
<p>we could make a run-make test</p>



<a name="241165811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165811">(Jun 02 2021 at 15:28)</a>:</h4>
<p>maybe one already exists</p>



<a name="241165871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165871">(Jun 02 2021 at 15:29)</a>:</h4>
<p>Yep one exists</p>



<a name="241165956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241165956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241165956">(Jun 02 2021 at 15:29)</a>:</h4>
<p><a href="https://github.com/rust-lang/rust/blob/master/src/test/run-make/unstable-flag-required/README.md">https://github.com/rust-lang/rust/blob/master/src/test/run-make/unstable-flag-required/README.md</a></p>



<a name="241166999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241166999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241166999">(Jun 02 2021 at 15:36)</a>:</h4>
<p>Then add that too :)</p>



<a name="241167005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241167005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241167005">(Jun 02 2021 at 15:36)</a>:</h4>
<p>at that point I'm ready to r+</p>



<a name="241167029"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241167029" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241167029">(Jun 02 2021 at 15:36)</a>:</h4>
<p>I feel happy with the semantics s is but I'm also open to others</p>



<a name="241168076"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241168076" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241168076">(Jun 02 2021 at 15:44)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116009">nikomatsakis</span> <a href="#narrow/stream/268952-edition-2021/topic/force.20warn/near/241148373">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="120518">Eric Huss</span> are you thinking that the flag would be used to dump JSON that would be gathered up by cargo?</p>
</blockquote>
<p>Yea. Instead of having the extra machinery and JSON structures, cargo would instead pass something like <code>--force-warn future-breakage</code> where <code>future-breakage</code> is a new lint group that contains things we want to warn about. Cargo would still collect those into a report.  I'm just thinking it would simplify things (less code, simpler JSON interface).</p>
<p>Or, alternatively, those lints are <em>always</em> included as <code>force-warn</code>.  My thinking here is that why would we want to hide these warnings?  This may make the integration for non-cargo build systems easier if they don't want to deal with the hassle of passing <code>--force-warn</code> and collecting results into a report.</p>



<a name="241170144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241170144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241170144">(Jun 02 2021 at 15:59)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> have you seen felix's RFC?</p>



<a name="241170161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241170161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241170161">(Jun 02 2021 at 15:59)</a>:</h4>
<p>I believe we want to hide those warnings and present them to the user in an actionable format</p>



<a name="241170467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241170467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241170467">(Jun 02 2021 at 16:01)</a>:</h4>
<p>Yea, I've read it a number of times.  Cargo would still collect them into an actionable format.  My consideration is for non-cargo systems.  They will unlikely be updated to have specific support for this, which means these warnings may never be seen in those situations.</p>



<a name="241170715"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241170715" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241170715">(Jun 02 2021 at 16:03)</a>:</h4>
<p>My expectation is that these warnings should be extremely rare, but when they do exist, I think it is important that they become apparent.  That's why I'm considering for non-cargo systems to make it easier to surface those warnings in some way.</p>



<a name="241170736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241170736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241170736">(Jun 02 2021 at 16:03)</a>:</h4>
<p>Instead of expecting them to also re-implement a reporting system.</p>



<a name="241170869"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241170869" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241170869">(Jun 02 2021 at 16:04)</a>:</h4>
<p>(Or expecting them to never see the warnings.)</p>



<a name="241171577"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241171577" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241171577">(Jun 02 2021 at 16:09)</a>:</h4>
<p>I have to go for the day. I've pushed the remaining changes (with the exception of adding a run-make test which I don't have time to do today). Feel free to wait on review until tomorrow or to r+ and merge today and I can add a run-make test as a follow-up.</p>



<a name="241171892"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241171892" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241171892">(Jun 02 2021 at 16:12)</a>:</h4>
<p>I’m trying to play catch up here: Is the intention to have a <em>parallel</em> system to the report-future-incompat diagnostic system?</p>



<a name="241171905"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241171905" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241171905">(Jun 02 2021 at 16:12)</a>:</h4>
<p>or to merge the two in some way?</p>



<a name="241172233"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241172233" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241172233">(Jun 02 2021 at 16:14)</a>:</h4>
<p>Hm, I tried the PR with <code>--cap-lints</code>, and it seems like cap-lints takes precedence.  I assume that is due to <a href="https://github.com/rust-lang/rust/blob/2f601ef527a37de9fb181c5fb1a6c06d06218ed3/compiler/rustc_errors/src/lib.rs#L557-L559">this</a> which cancels the diagnostic. I was playing with an experiment where I had an override for that.</p>



<a name="241172282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241172282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241172282">(Jun 02 2021 at 16:15)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span>  To merge them essentially.</p>



<a name="241172442"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241172442" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241172442">(Jun 02 2021 at 16:16)</a>:</h4>
<p>The intention is to simplify things and remove some of the special-case code. The user experience with Cargo would be the same, the questions I had was around what the experience for non-cargo users should be.</p>



<a name="241172983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241172983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241172983">(Jun 02 2021 at 16:21)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> would you mind posting link to the “force-warn” gist of niko’s that you mentioned at the outset?</p>



<a name="241173050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173050">(Jun 02 2021 at 16:21)</a>:</h4>
<p>Okay, I believe I’m in favor of merging (or generalizing the existing tech) rather than making two distinct-yet-similar systems</p>



<a name="241173094"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173094" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173094">(Jun 02 2021 at 16:21)</a>:</h4>
<p>(I'm still working on establishing context, but also am being forced to reboot laptop. Back soon!)</p>



<a name="241173160"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173160" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173160">(Jun 02 2021 at 16:22)</a>:</h4>
<p><span class="user-mention" data-user-id="116083">@pnkfelix</span> there is a pending MCP describing the system</p>



<a name="241173195"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173195" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173195">(Jun 02 2021 at 16:22)</a>:</h4>
<p><span class="user-mention silent" data-user-id="120518">Eric Huss</span> <a href="#narrow/stream/268952-edition-2021/topic/force.20warn/near/241172233">said</a>:</p>
<blockquote>
<p>Hm, I tried the PR with <code>--cap-lints</code>, and it seems like cap-lints takes precedence.  I assume that is due to <a href="https://github.com/rust-lang/rust/blob/2f601ef527a37de9fb181c5fb1a6c06d06218ed3/compiler/rustc_errors/src/lib.rs#L557-L559">this</a> which cancels the diagnostic. I was playing with an experiment where I had an override for that.</p>
</blockquote>
<p>good catch, we should add a test for that and fix it ... I think</p>



<a name="241173213"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173213" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173213">(Jun 02 2021 at 16:22)</a>:</h4>
<p>I mean in practice cap-lints is usually used for warn</p>



<a name="241173267"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173267" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173267">(Jun 02 2021 at 16:23)</a>:</h4>
<p>but I think the idea that <code>--force-warn</code> can be used as a very simple way to get warnings about you deps (when not using cargo) makes sense to me</p>



<a name="241173326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173326">(Jun 02 2021 at 16:23)</a>:</h4>
<p><span class="user-mention silent" data-user-id="116083">pnkfelix</span> <a href="#narrow/stream/268952-edition-2021/topic/force.20warn/near/241172983">said</a>:</p>
<blockquote>
<p><span class="user-mention silent" data-user-id="120518">Eric Huss</span> would you mind posting link to the “force-warn” gist of niko’s that you mentioned at the outset?</p>
</blockquote>
<p><del>https://gist.github.com/nikomatsakis/9e3e1b9117839aa80a803b1faf320ef9</del> Yea, the mcp link is better.</p>



<a name="241173335"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173335" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173335">(Jun 02 2021 at 16:23)</a>:</h4>
<p><a href="https://github.com/rust-lang/compiler-team/issues/434">https://github.com/rust-lang/compiler-team/issues/434</a></p>



<a name="241173347"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173347" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173347">(Jun 02 2021 at 16:23)</a>:</h4>
<p>MCP <span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span></p>



<a name="241173827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241173827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241173827">(Jun 02 2021 at 16:26)</a>:</h4>
<p>The override I added was in <code>struct_lint_level_impl</code>, something like this:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gu">@@ -263,6 +271,9 @@ fn struct_lint_level_impl(</span>
             (Level::Deny | Level::Forbid, Some(span)) =&gt; sess.struct_span_err(span, ""),
             (Level::Deny | Level::Forbid, None) =&gt; sess.struct_err(""),
         };
<span class="gi">+        if has_future_breakage &amp;&amp; err.cancelled() &amp;&amp; sess.opts.debugging_opts.emit_future_incompat_report {</span>
<span class="gi">+            err.level = rustc_errors::Level::Warning;</span>
<span class="gi">+        }</span>
</code></pre></div>
<p>very hacky, and I'm not sure how that could be adapted to force-warn.</p>



<a name="241176105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241176105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> pnkfelix <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241176105">(Jun 02 2021 at 16:44)</a>:</h4>
<p>Ah an MCP is a good place for this</p>



<a name="241361391"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241361391" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241361391">(Jun 03 2021 at 08:27)</a>:</h4>
<p>/me is catching up on the future-compat RFC.</p>



<a name="241361469"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241361469" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241361469">(Jun 03 2021 at 08:29)</a>:</h4>
<p>So it sounds like we want to use this mechanism for the mechanics proposed in <a href="https://github.com/rust-lang/rfcs/blob/master/text/2834-cargo-report-future-incompat.md">@**pnkfelix**'s RFC</a>. I can work on adding a test and trying to fix the cap-lints issue</p>



<a name="241389303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241389303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241389303">(Jun 03 2021 at 13:21)</a>:</h4>
<p>Great</p>



<a name="241478847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241478847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241478847">(Jun 04 2021 at 01:22)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> I R+'d the PR in any case because that seemed like follow-up work</p>



<a name="241505221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241505221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241505221">(Jun 04 2021 at 08:30)</a>:</h4>
<p>It's on my list today to look into the cap-lints issue.</p>



<a name="241505488"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241505488" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241505488">(Jun 04 2021 at 08:33)</a>:</h4>
<p>Should we just merge the PR as is and follow up with another PR fixing the cap-lints issue? I've had some PRs stall and I'm keen on just getting them in when they work even if there are some unresolved issues.</p>



<a name="241514426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241514426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241514426">(Jun 04 2021 at 10:05)</a>:</h4>
<p>Taking a look at the cap-lints issue (which also is an issue when using <code>--allow warnings</code>). When we build a session, <a href="https://github.com/rust-lang/rust/blob/4afa3a80926f52aa361fe4e89643dac2e2e57f34/compiler/rustc_session/src/session.rs#L1265-L1273">we turn off warnings globally</a> by looking to see if <code>cap-lints</code> is set to <code>allow</code> OR if <code>--allow</code> is set to <code>warnings</code>. <br>
It looks like to fix this we'll need to be smarter about when to turn off warnings. Unfortunately, we want to ignore the <code>can_emit_warnings</code> flag for specific lints but the <code>DiagnosticBuilder</code> has no knowledge of specific lints, and we probably want to keep it that way.</p>



<a name="241529282"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241529282" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241529282">(Jun 04 2021 at 12:41)</a>:</h4>
<p>Coming back to this, the closest I was able to come was something like this: <a href="https://github.com/rylev/rust/compare/force-warns...rylev:force-warnings-always">https://github.com/rylev/rust/compare/force-warns...rylev:force-warnings-always</a> but this probably breaks a bunch of other stuff. _Usually_ when <code>can_emit_warnings</code> is false, the diagnostic is canceled so this works in the new cases together with <code>--force-warns</code>.</p>



<a name="241530942"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241530942" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241530942">(Jun 04 2021 at 12:57)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> I was wondering if you consider the "uncancel" approach mentioned above is too hacky?  I don't particularly like it, but it does avoid the things that could break (like the deduplication logic).  Unfortunately <code>struct_warn</code> doesn't have enough context to know if it should be forced.</p>



<a name="241531811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241531811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241531811">(Jun 04 2021 at 13:05)</a>:</h4>
<p>This is similar to what I do here: <a href="https://github.com/rylev/rust/compare/force-warns...rylev:force-warnings-always">https://github.com/rylev/rust/compare/force-warns...rylev:force-warnings-always</a> I just uncancel in a place where it's a bit clearer that we're in a force-warn situation.</p>



<a name="241531914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241531914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241531914">(Jun 04 2021 at 13:06)</a>:</h4>
<p>As for whether this is too hacky, I'm not sure. I'd rather not have to rearchitect how --cap-lints and --allow warnings works</p>



<a name="241532015"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241532015" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241532015">(Jun 04 2021 at 13:07)</a>:</h4>
<p>oh, I see, I'm blind! <span aria-label="grinning" class="emoji emoji-1f600" role="img" title="grinning">:grinning:</span></p>



<a name="241532090"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241532090" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241532090">(Jun 04 2021 at 13:08)</a>:</h4>
<p>I was confused by moving the has_future_breakage stuff.</p>



<a name="241532110"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241532110" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241532110">(Jun 04 2021 at 13:08)</a>:</h4>
<p>Yea, I think that should work.</p>



<a name="241532211"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241532211" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241532211">(Jun 04 2021 at 13:09)</a>:</h4>
<p>I can open up a PR for this to see what happens when we run bors on it. (I ran a big chunk of the test suite and it passed locally), but I'd like to merge the --force-warns PR first</p>



<a name="241532216"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241532216" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241532216">(Jun 04 2021 at 13:09)</a>:</h4>
<p>thanks for taking a look at fixing it!</p>



<a name="241805161"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241805161" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241805161">(Jun 07 2021 at 16:43)</a>:</h4>
<p><span class="user-mention" data-user-id="224872">@rylev</span> The <code>--force-warns</code> flag doesn't seem to work with groups, do you happen to know why that is? For example, <code>--force-warns rust-2018-compatibility</code> returns <code>error[E0602]: unknown lint: `rust-2018-compatibility` </code>.</p>



<a name="241823689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241823689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241823689">(Jun 07 2021 at 18:57)</a>:</h4>
<p><span class="user-mention" data-user-id="120518">@Eric Huss</span> hmmm… that should work. We have several test cases involving lint groups. I’ll take a look at this tomorrow.</p>



<a name="241837902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/241837902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#241837902">(Jun 07 2021 at 20:42)</a>:</h4>
<p>I figured it out, it wasn't supporting dashes in the lint name.  Posted <a href="https://github.com/rust-lang/rust/pull/86117">https://github.com/rust-lang/rust/pull/86117</a> with a fix.</p>



<a name="243659563"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/243659563" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#243659563">(Jun 23 2021 at 14:26)</a>:</h4>
<p>Submitted a fix for the --cap-lints issue <a href="https://github.com/rust-lang/rust/pull/86572">here</a>. Need to work with <span class="user-mention" data-user-id="248906">@cjgillot</span> on their refactoring of how we handle --force-warns though before we start the stabilization work</p>



<a name="244256921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/244256921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#244256921">(Jun 29 2021 at 09:56)</a>:</h4>
<p><span class="user-mention" data-user-id="310399">@Mara</span> <span class="user-mention" data-user-id="116009">@nikomatsakis</span> - <span class="user-mention" data-user-id="248906">@cjgillot</span> posted a <a href="https://github.com/rust-lang/rust/pull/86009">PR</a> which makes force-warn just another lint level. Essentially force-warn is to warn as forbid is to deny. Do we still like the name <code>force-warn</code>? I believe the name was picked quickly and was not thoroughly bike shed.</p>



<a name="244257156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/244257156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#244257156">(Jun 29 2021 at 09:58)</a>:</h4>
<p>We can probably land the PR first, and bike shed the name as part of stabilization</p>



<a name="244261547"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/244261547" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#244261547">(Jun 29 2021 at 10:41)</a>:</h4>
<p>sounds good</p>



<a name="245171444"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245171444" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245171444">(Jul 07 2021 at 12:31)</a>:</h4>
<p>I'm going to work on stabilization of the force warn feature. One question:<br>
Is everyone happy with the name force-warn? It behaves just like a warn, except that it always warns. <code>force-warn</code> sounds appropriate to me.</p>



<a name="245172958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245172958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245172958">(Jul 07 2021 at 12:44)</a>:</h4>
<p>sounds okay to me. <code>always-warn</code> could also work.</p>



<a name="245190877"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245190877" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245190877">(Jul 07 2021 at 14:41)</a>:</h4>
<p>Either of those names sound fine to me.  </p>
<p>One thing I would note is possible confusion about the trailing <code>s</code>.  I noticed you wrote it without, but the flag is actually <code>--force-warns</code>.  Was there a discussion to change that from the original proposal?  I admit, I wrote it wrong a few times when I first started testing it, but I am biased since I had read the proposal that used <code>--force-warn</code>, so it may not be confusing to any users.</p>



<a name="245191666"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245191666" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245191666">(Jul 07 2021 at 14:46)</a>:</h4>
<p>The original proposal was <code>--force-warns</code> which is why I implemented it like that. Though there's been a shift in implementation that has also caused me to think differently about the option. </p>
<p>Now, <code>--force-warns</code> is simply another type of level that a lint can be emitted at. For instance, just like you can turn an allow-by-default lint into a warning by using <code>-W</code>, you can take that same lint and ensure it's warned with <code>--force-warns</code></p>



<a name="245191706"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245191706" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245191706">(Jul 07 2021 at 14:46)</a>:</h4>
<p>I think it's clear we at least need to remove the "s" at the end.</p>



<a name="245191881"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245191881" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245191881">(Jul 07 2021 at 14:47)</a>:</h4>
<p>But by analogy of the other flags (i.e., -A, -F, -W, etc.), I could also see changing it to just <code>-FW</code> or something of the like</p>



<a name="245203743"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245203743" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245203743">(Jul 07 2021 at 16:03)</a>:</h4>
<p>-FW seems ambiguous with -F -W, I don't think this option needs a shorthand</p>



<a name="245205021"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245205021" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245205021">(Jul 07 2021 at 16:13)</a>:</h4>
<p>-A -F -W: Always Force Warning <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="245205063"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245205063" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245205063">(Jul 07 2021 at 16:13)</a>:</h4>
<p>-L: Loud warning</p>



<a name="245220074"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/245220074" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#245220074">(Jul 07 2021 at 18:09)</a>:</h4>
<p>+1 to removing the trailing <code>s</code></p>



<a name="247190899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/force%20warn/near/247190899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> rylev <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/force.20warn.html#247190899">(Jul 26 2021 at 11:37)</a>:</h4>
<p>Stabilization report has been filed: <a href="https://github.com/rust-lang/rust/issues/86516#issuecomment-886624828">https://github.com/rust-lang/rust/issues/86516#issuecomment-886624828</a> <br>
Stabilization WIP PR has been opened: <a href="https://github.com/rust-lang/rust/pull/87472">https://github.com/rust-lang/rust/pull/87472</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>